import React from 'react';

import Constants from '../../common/Constants';
import BaseAction from '../common/BaseAction';
import ResponseConstants from '../../common/ResponseConstants';

export default class HeartLoveSendLikeUserAction extends BaseAction {
  constructor() {
    super();

    this.moduleType = Constants.MODULE_TYPE.HEART;
    this.name = "HeartLoveSendLikeUserAction";
  }

  call(caller, data) {
    this._baseCall(caller, data);
    this.caller.setState({
      likeStatus: 2,
    })
  }

  finish(data, isSucceed) {
    let likeSuccess = false;
    if(isSucceed) {
      if(data.status == ResponseConstants.status_deal_success) {
        likeSuccess = true;
      }
    }
    this.caller.setState({
      likeSuccess: likeSuccess,
    })
  }
}
